/*
编写 : Hexh
时间 : 2012-6-15 9:02:48
*/
using System;
using System.Collections.Generic;
using FsCarInfo.Core.Entity;
using FsCarInfo.Core.Entity.IRespositories;
using HMIS.FrameWork;
using HMIS.FrameWork.DomainBase;

namespace FsCarInfo.Facade.Impl
{
	/// <summary>
	///	 the impl of IFsCarInventoryFacade
	/// </summary>
	public class FsCarInventoryFacadeImpl : IFsCarInventoryFacade
	{

		private readonly IFsCarInventoryRepository FsCarInventoryRepository;

		public FsCarInventoryFacadeImpl(IFsCarInventoryRepository FsCarInventoryRepository)
        {
			this.FsCarInventoryRepository = FsCarInventoryRepository;
        }

        #region IFsCarInventory Entity Save,Get,Update,Delete

		public FsCarInventory Get(string id)
		{
			return FsCarInventoryRepository.Get(id);
		}

		public FsCarInventory Load(string id)
		{
			return FsCarInventoryRepository.Load(id);
		}

		public string CreateNewInventory(string deptId, string type, string userId)
		{
			return this.FsCarInventoryRepository.CreateNewInventory(deptId, type, userId);
		}

		public void SaveOrUpdate(FsCarInventory entity)
		{
			this.FsCarInventoryRepository.SaveOrUpdate(entity);
		}

		public void Delete(string id)
		{
			FsCarInventoryRepository.Delete(id);
		}
		
		public void PhysicsDelete(string id)
		{
			FsCarInventoryRepository.PhysicsDelete(id);
		}

		public bool IsFieldExist(string fieldName, string fieldValue, string id)
		{
			return FsCarInventoryRepository.IsFieldExist(fieldName, fieldValue, id);
		}
		
		public bool IsFieldExistWhere(string fieldName, string fieldValue, string id, string where)
		{
			return FsCarInventoryRepository.IsFieldExistWhere(fieldName, fieldValue, id, where);
		}
		
		#endregion
		
		#region Query 

		public IList<FsCarInventory> GetAll()
		{
			return FsCarInventoryRepository.GetAll();
		}

		public IList<FsCarInventory> GetPlist(string deptId, string type, string state, int start, int limit, string sort, string dir, List<DataFilter> filters, out long total)
        {
			return FsCarInventoryRepository.GetPlist(deptId, type, state, start, limit, sort, dir, filters, out total);
        }
		
		#endregion
	}
}
